package com.wymobilearchitecture.heade_frist.state.state;

import com.wymobilearchitecture.heade_frist.state.CandyMachine;

/**
 * 售空状态
 * 执行售空逻辑
 */
public class SellShortStateItem implements State{

    private CandyMachine candyMachine;
    public SellShortStateItem(CandyMachine candyMachine){
        this.candyMachine = candyMachine;
    }

    @Override
    public void insertQuarter() {
        System.out.println("已售空,无法投币");
        candyMachine.setState(candyMachine.sellShortStateItem);
    }

    @Override
    public void ejectQuarter() {
        System.out.println("已售空,无法退币");
        candyMachine.setState(candyMachine.sellShortStateItem);
    }

    @Override
    public void dispense() {
        System.out.println("已售空,无法发糖");
        candyMachine.setState(candyMachine.sellShortStateItem);
    }
}
